/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 * use AxisLineTick
 *
 * @author: jin Chen
 * @date: Jan 29, 2005$
 * @version: 1.0
 */
package edu.psu.geovista.app.plot.ruler;

import edu.psu.geovista.app.plot.ruler.tick.AxisLineTick;
import edu.psu.geovista.app.plot.ruler.tick.AxisLineTickFactory;
import edu.psu.geovista.app.plot.ruler.tick.Tick;
import edu.psu.geovista.app.plot.ruler.tick.TicksFactory;

import java.awt.*;

public class AxisTickRulerUI extends DfRulerUI{
    public AxisTickRulerUI(Ruler ruler) {
        super(ruler);
    }
    protected  void setupTicksLooks(Tick[] ticks) {
        //set loc type
        for (int i=0;i<ticks.length ;i++){
            AxisLineTick tick = (AxisLineTick) ticks[i];
            tick.setOrient(this.getTicksOrient());
            tick.setLength(5);// 
            tick.setColor(ruler.getColor());
            tick.setAxisLineColor(Color.GRAY);
            tick.setAxisLineStroke(new BasicStroke(1)) ;

        }

    }

    public void setTickAxisLineLength(int length){
        Tick[] ticks = this.getTicks();
        for (int i=0;i<ticks.length ;i++){
            AxisLineTick tick = (AxisLineTick) ticks[i];
            tick.setAxisLineLength(length);
        }
    }
    /**
     *  
     * @return
     */
    public TicksFactory getTicksFactory(){
        if(ticksFactory==null)
            ticksFactory= new AxisLineTickFactory();
        return ticksFactory;
    }
}
